Conversation
Add SetMaxRetry and GetMaxRetry to ApiAsyncClient for change maxRetry after created. Nddtfjiang <zhicheng.jiang@merico.dev>
fix an error lost in DoAsync of ApiAsyncClient, after ReadAll. Nddtfjiang <zhicheng.jiang@merico.dev>
Check if the log is nil befor log print In Log of DefaultLogger. Nddtfjiang <zhicheng.jiang@merico.dev>
f73af83 to
56ee3ce
Compare
TestWaitAsync_EmptyWork TestWaitAsync_WithWork TestWaitAsync_MutiWork TestDoAsync_OnceSuceess TestDoAsync_TryAndFail TestDoAsync_TryAndSuceess Add gomonkey Nddtfjiang <zhicheng.jiang@merico.dev>
| body, err = ioutil.ReadAll(res.Body) | ||
| res.Body.Close() | ||
| res.Body = io.NopCloser(bytes.NewBuffer(body)) | ||
| if err == nil { |
Contributor
There was a problem hiding this comment.
It seems res.Body will not be closed in the case of err != nil
mindlesscloud
approved these changes
Apr 26, 2022
add defer in DoAsync for close the http response. add res.body.close() when afterReponse failed befor it return a nil res. Nddtfjiang <zhicheng.jiang@merico.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unit test for api_async_client
Key Points
Description
fix some bugs and add unit test for api_async_client
Does this close any open issues?
close https://github.com/merico-dev/lake/issues/1665
close https://github.com/merico-dev/lake/issues/1737
close https://github.com/merico-dev/lake/issues/1738
close https://github.com/merico-dev/lake/issues/1739
close https://github.com/merico-dev/lake/issues/1753
Current Behavior
Describe the current behaviour of this issue, if relevant.
New Behavior
Describe the new behaviour updated in this issue, if relevant.
Screenshots
Include any relevant screenshots here.
Other Information
Any other information that is important to this PR.